<% if try_spree_current_user %>
  <div class="btn-group">

    <button id="accountNav" type="button" class="btn text-light" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
      <%= svg_icon name: "user.svg", width: '24', height: '24' %>
    </button>

    <div class="dropdown-menu dropdown-menu-right overflow-hidden mt-2 p-0 mr-2">
      <div class="dropdown-item px-0 text-center bg-light">
        <span class="d-block text-dark py-2 px-4"><%= try_spree_current_user.email %></span>
      </div>
      <div class="dropdown-divider m-0"></div>

      <% if spree.respond_to? :root_path %>
          <%= link_to spree.root_path, target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
            <%= svg_icon name: "store.svg", width: '18', height: '18' %>
            &nbsp;
            <%= Spree.t(:back_to_store) %>
          <% end %>
      <% end %>

      <% if can?(:manage, try_spree_current_user) %>
          <%= link_to spree.edit_admin_user_path(try_spree_current_user), class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
            <%= svg_icon name: "user.svg", width: '18', height: '18' %>
            &nbsp;
            <%= Spree.t(:account) %>
          <% end %>
      <% end %>

      <% if admin_logout_link %>
          <%= link_to admin_logout_link, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
            <%= svg_icon name: "exit.svg", width: '18', height: '18' %>
            &nbsp;
            <%= Spree.t(:logout) %>
          <% end %>
      <% end %>

      <div class="dropdown-divider m-0"></div>

        <%= link_to 'http://guides.spreecommerce.org', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
        <%= svg_icon name: "info.svg", width: '18', height: '18' %>
          &nbsp;
          <%= Spree.t(:help_center) %>
        <% end %>

        <%= link_to 'http://slack.spreecommerce.org', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
        <%= svg_icon name: "slack.svg", width: '18', height: '18' %>
          &nbsp;
          <%= Spree.t(:join_slack) %>
        <% end %>

        <%= link_to 'https://github.com/spree-contrib', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
        <%= svg_icon name: "extensions.svg", width: '18', height: '18' %>
          &nbsp;
          <%= Spree.t(:extensions_directory) %>
        <% end %>
    </div>
  </div>
<% end %>
